java.lang.ObjectFieldStats
public class FieldStats
This class collects and provides some statistical data on the state of a field. It is flexible: it will create and maintain a counter for any class of object that is found within the field.
| Constructor Summary | |
|---|---|
FieldStats()
Construct a FieldStats object. |
|
| Method Summary | |
|---|---|
void |
countFinished()
Indicate that an animal count has been completed. |
int |
getPopulationCount(Field field,
java.lang.Class key)
Get the number of individuals in the population of a given class. |
java.lang.String |
getPopulationDetails(Field field)
Get details of what is in the field. |
void |
incrementCount(java.lang.Class animalClass)
Increment the count for one class of animal. |
boolean |
isViable(Field field)
Determine whether the simulation is still viable. |
void |
reset()
Invalidate the current set of statistics; reset all counts to zero. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FieldStats()
| Method Detail |
|---|
public void countFinished()
public int getPopulationCount(Field field,
java.lang.Class key)
public java.lang.String getPopulationDetails(Field field)
public void incrementCount(java.lang.Class animalClass)
animalClass - The class of animal to increment.public boolean isViable(Field field)
public void reset()